<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="java.util.*"%>
<%@page import= "Model.EBInfo"%>
<html>
<head>
<%@ page import="java.sql.*" %>
<%@page import="DAO.DBCon"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>员工查询页面</title>
</head>
<style>
p.top
{
	background-color:#e6e4e4;
	border:3px solid red;
	border-radius:10px;
	margin-top:0px;
	margin-bottom:0px;
	margin-color:#e6e4e4;
}
.font{
	font-family: SimSun;
	font-weight: bold;
	font-size: 25px;
}
.button1{
	position:absolute;
	top:800px;
	left:830px;
	width: 100px;
	height: 40px;
	background-color:yellow;
	border-radius: 10px;
	font-family: SimSun;
	font-size: 15px;
	font-weight:bold;	
}
.button2{
	position:absolute;
	top:800px;
	left:1030px;
	width: 100px;
	height: 40px;
	background-color:yellow;
	border-radius: 10px;
	font-family: SimSun;
	font-size: 15px;
	font-weight:bold;	
}
body{
	background-color:#e6e4e4;
}
</style>
<body>
	<p class="top" align="center"><font size="40px" weight="bold">员工信息查询界面</font></p>
	<form action="EBISearch" method="post">
		<p>请输入要查询的信息：
		<%	
			DBCon dbCon = new DBCon();
			Connection conn = dbCon.getConnection();
			String sql="select * from ebit91";
		%>
			<select name="con" size="1">
				<option value="已婚">已婚</option>
				<option value="未婚">未婚</option>
				<option value="高中">高中</option>
				<option value="大专">大专</option>
				<option value="大学及以上">大学及以上</option>
				<% try{
					PreparedStatement stmt = conn.prepareStatement(sql);
					ResultSet rs = stmt.executeQuery();
					while(rs.next()){
						out.print("<option value=\""+rs.getString("Pname")+"\">");
						out.print(rs.getString("Pname")+"</option>");
						out.print("<option value=\""+rs.getString("Pstatus")+"\">");
						out.print(rs.getString("Pstatus")+"</option>");
					}
					rs.close();
					stmt.close();
					conn.close();
				}catch(Exception e){
					e.printStackTrace();
				}
				%>
			</select>
			<input type="submit" value="查询">
			当前查询调件：<%=session.getAttribute("con") %>
		</p>
	</form>
		<p align="center">
		<table border="1">
		<tr>
		<th width=150>部门</th>
		<th width=150>职位</th>
		<th width=150>姓名</th>
		<th width=150>员工号</th>
		<th width=150>职位状态</th>
		<th width=150>学历</th>
		<th width=150>婚姻状况</th>
		<th width=150>操作</th>
		</tr>
		<%
			int i=1;
			List list = new ArrayList();
			list = (List) session.getAttribute("eList");
			
			if(list!=null){
				Iterator<EBInfo> it = list.iterator();
				
				while(it.hasNext()){
					EBInfo ebi = (EBInfo) it.next();
		%>
			<tr>
			<td style="border:1px"><%=ebi.getDname() %></td>
			<td style="border:1px"><%=ebi.getPname() %></td>
			<td style="border:1px"><%=ebi.getName() %></td>
			<td style="border:1px"><%=ebi.getWorkID() %></td>
			<td style="border:1px"><%=ebi.getPstatus() %></td>
			<td style="border:1px"><%=ebi.getEducation() %></td>
			<td style="border:1px"> <%=ebi.getMstatus() %></td>
			<td style="border:1px">
			<form method="post" action="EBISearch1" name="<%=i %>">
				<input align="center" type="submit" value="查看人员情况">
				<input type="hidden" name="hidden" value="<%=ebi.getWorkID()%>">
			</form>
			<input type="button" onclick="window.location.href='EBIChangeDel?workID1=<%=ebi.getWorkID() %>'" value="删除员工信息" >
			</td>
			</tr>
		</table>
		</p>
					
		<% 
				i++;
				}
			}
		%>
	<p align="center">
		<input type="button"  onclick="window.location.href='EBIChangeIn.jsp'" class="button1" value="插入员工信息">
		<input type="button"  onclick="window.location.href='EDIChange.jsp'" class="button2" value="返回">
	</p>
</body>
</html>